<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:th="http://www.thymeleaf.org">
<head>
<title>首页</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
	<div class="container"  id="content">
		 <section class="content-header">
			 <h1>
				 <i class="fa fa-send"></i>
				 <strong>信息登记</strong>
			 </h1>
			 <ol class="breadcrumb">
				 <li><a href="#"><i class="fa fa-home "></i>Home</a></li>
				 <li>信息管理</li>
				 <li class="active">信息登记</li>
			 </ol>
		 </section>
		 <!-- Main content -->
		 <section class="content">
                <div class="row">
                    <div class="col-md-12">
                        <div class="box box-info">
                            <div class="box-header with-border">
                                <i class="fa fa-th-list"></i>
                                <h4 class="box-title">销售信息登记表</h4>
                            </div>
                            <form id="chanceRegisterForm" class="widget-box">
                            <input type="hidden" name="id" id="id"/>
                            <input type="hidden" name="isSubmit" id="isSubmit" value="0"/>
                            <input type="hidden" name="creator" id="creator" th:value="${userName}"/>
                            <input type="hidden" name="userId" id="userId" th:value="${userId}"/>
                            <input type="hidden" name="sourceSuperior" id="sourceSuperior" th:value="${userSuperior}"/>
			                	<div class="widget-content nopadding">
								<table class="table table-bordered">
						            <tbody>
						            <tr class="odd gradeX">
						             <td width="8%" class="center">信息名称</td>
						              <td colspan="3">
						              <div class="col-md-11">
						              <input class="form-control" type="text" id="name" name="name" datatype="*,*1-100,t"/>
			                          </div>
			                          <div class="col-md-1">
			                          <span style="color:#F00">*</span>
			                          </div>
			                          </td>
			                          <td width="8%" class="center">重要程度</td>
						              <td width="16%">
						              <div class="col-md-11">
						              <select class="form-control" type="text" id="chancePriority" name="chancePriority" datatype="*,*1-100,t">
						              <option>☆</option>
						              <option>☆☆</option>
						              <option>☆☆☆</option>
						              <option>☆☆☆☆</option>
						              <option>☆☆☆☆☆</option>
						              </select>
			                          </div>
			                          <div class="col-md-1">
			                          <span style="color:#F00">*</span>
			                          </div>
			                          </td>
						             </tr>
						             <tr class="odd gradeX">
						              <td width="8%" class="center">信息来源</td>
						              <td width="16%">
						              <div class="col-md-11">
						              <select class="form-control" type="text" id="source" name="source" datatype="*,*1-100,t">
						              <option></option>
						              <option>设计院</option>
						              <option>走访</option>
						              <option>电话传真</option>
						              </select>
			                          </div>
			                          <div class="col-md-1">
			                          <span style="color:#F00">*</span>
			                          </div>
			                          </td>
						              <td width="8%" class="center">信息提供人片区</td>
						              <td width="16%">
						              <div class="col-md-11">
						              <select class="form-control" type="text" id="sourceArea" name="sourceArea" style="width: 100%">
											<option></option>
											<option th:each="saleArea:${peosaleAreas}"
												th:text="${saleArea.superiorArea}"
												th:selected="${saleArea.superiorArea.equals(userSuperiorArea)}">
												
											</option>
										</select>
			                          </div>
			                          <div class="col-md-1">
			                          <span style="color:#F00">*</span>
			                          </div>	
									  </td>
						              <td width="8%" class="center">设备主要类型</td>
						              <td width="16%">
						              <div class="col-md-11">
 						              <select class="form-control" type="text" id="sourceType" name="sourceType" datatype="*,*1-100,t"> 
						              <option>无</option>
						              <option>离心式</option>
						              <option>往复式</option>
						              <option>备件</option>
						              <option>单泵</option>
						              <option>计量泵</option>
						              <option>往复泵</option>
						              <option>液压隔膜泵</option>
						              <option>ZD泵</option>
						              <option>加药装置</option>
						              <option>其他泵</option>
						              </select>
			                          </div>
			                          <div class="col-md-1">
			                          <span style="color:#F00">*</span>
			                          </div>
			                          </td>
						             </tr>
						             <tr class="even gradeC">
						             <td width="8%" class="center">项目动态</td>
						              <td width="16%">
						              <div class="col-md-11">
						              <input class="form-control" type="text" id="projectState" name="projectState"/>
			                          </div>
			                          </td>
						              <td width="8%" class="center">信息来源单位</td>
						              <td width="16%">
						              <div class="col-md-11">
						              <input class="form-control" type="text" id="sourceUnit" name="sourceUnit" datatype="*,*1-100,t"/>
			                          </div>
			                          <div class="col-md-1">
			                          <span style="color:#F00">*</span>
			                          </div>	
									  </td>
						              <td width="8%" class="center">预计订货量（元）</td>
						              <td width="16%">
						              <div class="col-md-11">
						              <input class="form-control" type="text" id="orderAmount" name="orderAmount" datatype="*,n"/>
			                          </div>
			                          <div class="col-md-1">
			                          <span style="color:#F00">*</span>
			                          </div>
			                          </td>
						             </tr>
						             <tr>
						              <td width="8%" class="center">订货单位</td>
						              <td width="16%">
						              <div class="col-md-10 input-group" style="margin-left:8px;">
						              <input type="hidden" name="customerId" id="customerId"/>
						              <input readonly="readonly" class="form-control" type="text" id="orderUnit" name="orderUnit"/>
						              <span class="input-group-btn">
											<button type="button" id="queryCustomer" class="btn btn-info" title="引入客户"><i class="fa fa-search"></i></button>
										</span>
			                          </div>
			                          </td>
						              <td width="8%" class="center">设备情况</td>
						              <td width="16%">
						              <div class="col-md-11">
						              <input class="form-control" type="text" id="deviceState" name="deviceState"/>
			                          </div>
			                          </td>
						              <td width="8%" class="center">信息提供方影响力</td>
						              <td width="16%">
						              <div class="col-md-11">
						              <select class="form-control" type="text" id="sourcePower" name="sourcePower" datatype="*,*1-100,t">
						              <option></option>
						              <option>大</option>
						              <option>较大</option>
						              <option>一般</option>
						              <option>较小</option>
						              </select>
			                          </div>
			                          <div class="col-md-1">
			                          <span style="color:#F00">*</span>
			                          </div>
			                          </td>
						             </tr>
						             <tr>
						             <td width="8%" class="center">订货单位所属片区</td>
						              <td width="16%">
						              <div class="col-md-11">
						              <select class="form-control" style="width: 100%" type="text" id="orderUnitArea" name="orderUnitArea" datatype="*,*1-100,t">
						              <option></option>
						              <option th:each="saleArea:${saleAreas}"								
										    th:text="${saleArea.superiorArea}"											
										    >
	                                    </option>
						              </select>
			                          </div>
			                          <div class="col-md-1">
			                          <span style="color:#F00">*</span>
			                          </div>
						              </td>
						             <td width="8%" class="center">订货联系人</td>
						              <td width="16%">
						              <div class="col-md-11">
						              <input class="form-control" type="text" id="orderPerson" name="orderPerson"/>
			                          </div>
						              </td>
						              <td width="8%" class="center">联系方式</td>
						              <td width="16%">
						              <div class="col-md-11">
						              <input class="form-control" type="text" id="orderPersonPhone" name="orderAmountPhone" datatype="*,*1-100,t"/>
			                          </div>
			                          <div class="col-md-1">
			                          <span style="color:#F00">*</span>
			                          </div>
			                          </td>
						             </tr>
						             <!-- <tr>
						             	<td width="8%" class="center">收集人</td>
							              <td width="16%">
								              <div class="col-md-11">
								              	<input class="form-control" type="text" id="userName" name="userName" readonly="readonly" th:value="${userName}"/>
					                          </div>
				                          </td>
				                          <td>
				                          	<label class="col-sm-1 control-label">所属行业</label>
												<div class="col-sm-3">
												  <div class="col-md-11">
													<select class="form-control" id="business" name="business">
														<option th:each="business:${businesses}"								
													    th:text="${business.title}"
													    th:value="${business.value}"											
													    th:selected="${business.title.contains(customer.business)}">
	                                   					 </option>
													</select>
												  </div>
												</div>
				                          </td>
						             </tr> -->
						             <tr>
						             		<td width="8%" class="center">收集人</td>
							            	<td width="16%">
								              <div class="col-md-11">
								              	<input class="form-control" type="text" id="userName" name="userName" />
					                          </div>
				                          	</td>
				                          	<td width="8%" class="center">所属行业</td>
				                          	<td width="16%">
												<div class="col-md-11">
													<select class="form-control" id="busine" name="busine">
														 <option th:each="businesses:${businesses}"								
														    th:text="${businesses.title}">	
														   <!--  th:value="${businesses.value}" -->										
														    <!-- th:selected="${businesses.title.contains(customer.businesses)}" -->
	                                   					 </option> 
													</select>
												  </div>
											</td>
						             </tr>
						             <tr>
						             <td class="center">订货单位地址</td>
						              <td colspan="7">
						              <textarea class="form-control" type="text"  id="orderUnitAddr" name="orderUnitAddr" rows="3"></textarea>
			                          </td>
						             </tr>
						             <tr>
						             <td class="center">提供信息人资料</td>
						              <td colspan="7">
						              <textarea class="form-control" type="text" id="sourceOfferInfo" name="sourceOfferInfo" rows="3"></textarea>
			                          </td>
						             </tr>
						           	 <tr>
						             <td class="center">备注</td>        
							         <td colspan="7">
							          <textarea class="form-control" style="width:100%" name="memo"  id="memo" rows="3"></textarea>
							         </td>
							         </tr>     
						            </tbody>
						        </table>
							  </div>
							
							<div class="box-body">
							<div >
							<lable><strong>信息关键人物</strong></lable>
							<button type="button"  id="deleteBtn" class="btn btn-primary pull-right">删除</button>
							<button type="button" class="btn btn-primary pull-right editBtn">编辑</button>
							<button type="button"  id="addBtn" class="btn btn-primary pull-right">添加</button>
							</div>
							</div>
							<div class="box-body">
							<table id="keyManDataTable" class="mytable dataTable table-bordered text-center table-striped table-hover" cellspacing="0" width="100%">
                                    <thead>
                                        <tr>
                                            <th width="5%">序号</th>
											<th width="3%"><input type="checkbox" id="checkAll" /></th>
											<th width="10%">姓名</th>
											<th width="10%">职务</th>
											<th width="20%">联系方式</th>
											<th width="20%">称呼</th>
											<th width="32%">备注</th>
                							
                                        </tr>
                                    </thead>
                                    <tbody>
                                	
               						</tbody>
                                </table>
                    </div>
						<div >
							<a type="button" class="btn btn-default pull-right" href="javascript:history.go(-1)">返回</a>
							<button type="button" class="btn btn-primary pull-right saveBtn">保存</button>
							
						</div>
							  </form>
                        </div>
                    </div>
                </div>
            </section>
		  
	  <!--客户关键人物选择弹窗-->
    	<div class="modal" id="kehuModal">
        <div class="modal-dialog" role="dialog">
            <form id="keyManForm">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title"><strong>信息关键人物</strong></h4>
                    </div>
                    <div class="modal-body">
                        <div class="form-horizontal">
                            <div class="form-group">
                            <input type="hidden" name="keyManId" id="keyManId"/>
                                <label class="col-sm-2 control-label">姓名</label>
                                <div class="col-sm-4">
                                    <div class="col-md-11">
                                        <input class="form-control"  type="text" name="keyManName"  id="keyManName" datatype="*,*1-100,t"/>
                                    </div>
                                    <div class="col-md-1">
			                          <span style="color:#F00">*</span>
			                          </div>
                                </div>
                                <label class="col-sm-2 control-label">职务</label>
                                <div class="col-sm-4">
                                    <div class="col-md-11">
                                        <input class="form-control" type="text" name="business" id="business"/>
                                    </div>
                                    
                                </div>
                            </div>
                            <div class="form-group">
                            <label class="col-sm-2 control-label">联系方式</label>
                                <div class="col-sm-4">
                                    <div class="col-md-11">
                                      <input class="form-control" id="phone" name="phone" datatype="*,*1-100,t"/>
                                        
                                    </div>
                                    <div class="col-md-1">
			                          <span style="color:#F00">*</span>
			                          </div>
                                </div>
                                <label class="col-sm-2 control-label">称呼</label>
                                <div class="col-sm-4">
                                    <div class="col-md-11">
                                        <input class="form-control" type="text" name="callName" id="callName" />
                                    </div>
                                    
                                </div>
                                </div>
                                <div class="form-group">
                                <label class="col-sm-2 control-label">备注</label>
                                <div class="col-sm-10">
                                    <div class="col-md-11">
                                        <textarea class="form-control" type="text" name="keyMemo" id="keyMemo" datatype="*1-100" ></textarea>
                                    </div>
                                </div>
                                </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                       <button type="button" class="btn btn-info" id="KeyManSave">保存</button>
                        <button type="button" class="btn btn-default" data-dismiss="modal">返回</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    	  <!--引入客户信息弹窗-->
    	<div class="modal" id="queryCustomerModal">
        <div class="modal-dialog" role="dialog" style="width:60%">
            <form id="queryCustomerForm">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title"><strong>客户信息引入</strong></h4>
                    </div>
                    <div class="modal-body">
                        <div class="form-horizontal">
                            <div class="box-body">
                                <div class="form-inline">
                                	<div class="input-group">
										<input type="text" class="form-control" id="keyword"  placeholder="Search..." />
										<span class="input-group-btn">
											<button type="button" id="search-btn" class="btn btn-info searchBtn">查询</button>
                                            <button type="button" id="reset-btn" class="btn btn-info resetBtn">撤消</button>
										</span>
									</div>
								</div>
                            </div>
                            <div class="box box-body" >
                                <table id="customerTable" class="mytable dataTable table-bordered text-center table-striped table-hover" cellspacing="0" width="100%" align="center">
                                    <thead>
                                        <tr>
                                            <th width="10%">序号</th>
                							<th width="20%">单位名称</th>
                				            <th width="20%">所属片区</th>
                				            <th width="20%">行业</th>
                				            <th width="20%">上级单位</th>
                				            <th width="10%">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                	
               						</tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                       <button type="button" class="btn btn-info" id="pull-in">引入</button>
                        <button type="button" class="btn btn-default" data-dismiss="modal">返回</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
            <script th:src="@{/chance/chanceRegister.js}"></script>
    </div>
</body>
</html>